/*
* Conditions Of Use
*
* This software was developed by employees of the Sigmatrix(Beijing) Corporation.
* This software is provided by sigmatrix as a service and is expressly
* provided "AS IS."  Sigmatrix MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
* AND DATA ACCURACY.  Sigmatrix does not warrant or make any representations
* regarding the use of the software or the results thereof, including but
* not limited to the correctness, accuracy, reliability or usefulness of
* the software.
*
* Permission to use this software is contingent upon your acceptance
* of the terms of this agreement.
*
*/
package com.sigmatrix.h5.enums;

import java.util.HashMap;
import java.util.Map;

import com.sigmatrix.h5.enums.common.NamedEnumEntity;

/**
 *@ClassName: StatusEnum
 *@Description: 通用状态
 *@author youjun
 *@date 2017年7月27日 下午10:31:32
 */
public enum StatusEnum implements NamedEnumEntity<Integer> {

	/**删除*/
	STATUS_DELETE(-1, "删除"),
	
	/**禁用*/
	STATUS_DISABLE(0, "禁用"),
	
	/**启用*/
	STATUS_ENABLE(1, "启用");
	
	private Integer id;
	
	private String name;
	
	/**
	 *@Title: StatusEnum
	 *@Description: TODO
	 */
	private StatusEnum(final Integer id, final String name) {
		this.id = id;
		this.name = name;
	}

	/**
	 *@Title: getAll
	 *@Description: 获得所有状态map
	 *@return Map<Integer,String>
	 *@author youjun
	 *@date 2017年7月29日 下午8:55:51
	 *@return
	 */
	public static Map<Integer, String> getAll() {
		final Map<Integer, String> statusMap = new HashMap<Integer, String>();
		for(final StatusEnum item:StatusEnum.values()) {
			statusMap.put(item.getId(), item.getName());
		}
		return statusMap;
	}
	
	/**
	 *@return the id
	 */
	public Integer getId() {
		return id;
	}

	/**
	 *@return the name
	 */
	public String getName() {
		return name;
	}
	
}
